from pygame.sprite import Group
from aline import Aline

class Draw_aline_message:
    """显示外星人在屏幕上信息的类"""
    def __init__(self, ai_game):
        """初始化"""
        self.screen = ai_game.screen
        self.ai_game = ai_game
        self.screen_rect = ai_game.screen.ger_rect()
        self.settings = ai_game.settings
        self.show_alien_message()


    def prep_aliens(self):
        """显示还剩下多少生命"""
        self.aliens = Group()
        for alien_number in range(self.settings.alien_life):
            alien = Aline(self.ai_game)
            alien.rect.x = 10 + alien_number * alien.rect.width
            alien.rect.y = 10
            self.aliens.add(alien)

    def show_alien_message(self):
        """显示外星人的生命数"""
        self.aliens.draw(self.screen)